

register_crad_rule('无限手套-真',{'无限手套','空间宝石','时间宝石','现实宝石','力量宝石','心灵宝石','灵魂宝石'})

local mt = ac.skill['收集宝石']
local crads = {'空间宝石','时间宝石','现实宝石','力量宝石','心灵宝石','灵魂宝石'}

function mt:on_add()
    local hero = self.owner
    local player = hero.owner
    local num1 = 0
    local num2 = 0
    
    if hero[self.name] then
        return
    end
    hero[self.name] = true
    for _,name in ipairs(crads) do
        player:set_data(name,true)
    end

    self:gc(player:event '卡池-添加卡组'(function(_,_,pool)
        for _,name in ipairs(crads) do
            pool[#pool+1] = name
        end
    end))
    
    local count = 0
    self:gc(hero:add_buff(self.name){
        art = self.art,
        tip = self:get_tip(),
        keep = true,
        on_add = function(buff)
            buff:gc(hero:event '天赋-检测合成后'(function()
                local count = hero:get_data('无限手套-计数',0)
                local sum1 = self.data1*count
                local sum2 = self.data2*count
                buff.stack = count
                hero:add('基础攻击',sum1 - num1)
                hero:add('生命上限',sum2 - num2)
                num1 = sum1
                num2 = sum2
            end))
            buff:gc(function()
                hero:add('基础攻击',- num1)
                hero:add('生命上限',- num2)
            end)
        end
    })
end



local mt = ac.skill['打个响指']
mt.temp = '攻击触发'
mt.model1 = [[bdc9938415650acad2324288b4f0e7a9.mdl]]
function mt:on_run(hero,target)
    local point = target:get_point()
    local damage = hero:get(self['属性1']) * self.data1 / 100 + hero:get(self['属性2']) * self.data2 / 100
    for u in ac.selector('unit')
        : enemy(hero)
        : range(hero,9999)
        : loop()
    do
        u:add_effect(self.model1,nil,0.1)
        hero:create_damage(u,damage,self)
    end
end



